import Vue from 'vue'
import './support/cube-ui';
import App from './App.vue'
import router from './router'
import store from './store/index'
import './support/cube-ui'
import CommonUnit from './unit/CommonUnit'
import './support/viewport-units-buggyfill'
import './support/promise-polyfill';
import './assets/fonts/iconfont/iconfont'
import './support/wechat-title'
import Http from '@/service/Http'
import ApiUrl from '@/constant/ApiUrl'
import './support/filter'
import {deviceReady, updateVersionCode, updateVersionName, wechatReady} from './store/dispatches';

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')


window.onresize = () => {
    // if (process.env.NODE_ENV === 'development') {
    //     const code: string = `:root{--safe-area-inset-top:20px;--safe-area-inset-right:0px;--safe-area-inset-bottom:20px;--safe-area-inset-left:0px;@supports(top:constant(safe-area-inset-top)){--safe-area-inset-top:constant(safe-area-inset-top);--safe-area-inset-right:constant(safe-area-inset-right);--safe-area-inset-bottom:constant(safe-area-inset-bottom);--safe-area-inset-left:constant(safe-area-inset-left)}@supports(top:env(safe-area-inset-top)){--safe-area-inset-top:env(safe-area-inset-top);--safe-area-inset-right:env(safe-area-inset-right);--safe-area-inset-bottom:env(safe-area-inset-bottom);--safe-area-inset-left:env(safe-area-inset-left)}}`;
    //     const style: any = document.createElement('style');
    //     style.type = 'text/css';
    //     style.rel = 'stylesheet';
    //     style.appendChild(document.createTextNode(code));
    //     const head: any = document.getElementsByTagName('head')[0];
    //     head.appendChild(style);
    // }
    require('viewport-units-buggyfill').refresh();
};

document.addEventListener('deviceReady', () => {
    deviceReady();
});
